package com.next

class WorkflowStage
{
    Integer executionSequence
    String name
    Boolean canReject = true

    OpportunityLayout desktopLayout
    //后台页面布局
    OpportunityLayout mobileLayout
    //h5布局
    OpportunityLayout wechatLayout
    //微信布局
    String type
    //访问类型

    static belongsTo = [workflow: Workflow]

    static hasMany = [conditions: WorkflowCondition, events: WorkflowEvent]

    static constraints = {
        executionSequence unique: ['workflow'], min: 1, max: 10000
        name unique: ['workflow'], maxSize: 32
        desktopLayout nullable: true, blank: true
        mobileLayout nullable: true, blank: true
        wechatLayout nullable: true, blank: true
        type nullable: true, blank: true, maxSize: 32
        type inList: ["private", "public"]
    }

    static mappedBy = [conditions: 'stage']

    static mapping = {
        // id composite: ['territory', 'stage']
    }
}
